// 权限认证
import React, { useEffect, useState } from 'react';
import { Redirect } from 'umi';

export default (props: any) => {
  const token: string | null = localStorage.getItem('token');

  if (token) {
    return <div className="pro-test">{props.children}</div>;
  }
  localStorage.removeItem('token');
  return <Redirect to="/login" />;
};
